from multiprocessing import Process

# 全局变量
num = 100


def func():
    # 引入全局变量
    global num
    num -= 1  # num = num-1


if __name__ == '__main__':

    process_list = []
    for i in range(10):
        p = Process(target=func)
        p.start()
        process_list.append(p)

    for p in process_list:
        p.join()

    print(num)  # num=?  100
